package cn.agiledata.bank.account.dao;

import java.util.List;

import cn.agiledata.bank.hibernateBean.Account;
import com.vnv.infrastructure.logic.IPBHibernate3BaseMgr;

public class AccountDaoImpl extends IPBHibernate3BaseMgr implements AccountDao {
    public Account getAccountById(long id) {
        return (Account) getHibernateTemplate()
                .get(Account.class, new Long(id));
    }

    public Account getAccountByAccountId(String accountId) {
        String hql = "from Account a where a.accountId=?";
        List list = getHibernateTemplate().find(hql, accountId);
        return list.size() == 0 ? null : (Account) list.get(0);
    }
}
